package com.dragon.modules.yuegou.query.coupon;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.coupon.CouponScopeMerchantEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

/**
 * 优惠券指定商户 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2019-02-28 18:30:17
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class CouponScopeMerchantQuery extends CouponScopeMerchantEntity implements Query<CouponScopeMerchantEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 优惠券模板ID查询条件 */
	@JsonUnwrapped(prefix = "couponTemplateId")
	private Condition<String> couponTemplateIdCondition;

    /** 商户ID查询条件 */
	@JsonUnwrapped(prefix = "merchantId")
	private Condition<String> merchantIdCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public CouponScopeMerchantQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public CouponScopeMerchantQuery(CouponScopeMerchantEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public CouponScopeMerchantQuery(CouponScopeMerchantQuery other) {
		super(other);
		if(other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if(other.couponTemplateIdCondition != null) {
			this.couponTemplateIdCondition = other.couponTemplateIdCondition.copy();
		}
		if(other.merchantIdCondition != null) {
			this.merchantIdCondition = other.merchantIdCondition.copy();
		}
	}

	@Override
	public QueryWrapper<CouponScopeMerchantEntity> toQueryWrapper() {
		QueryWrapper<CouponScopeMerchantEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (couponTemplateIdCondition != null) {
			couponTemplateIdCondition.toWrapper(wrapper, COL_COUPON_TEMPLATE_ID);
		}
		if (merchantIdCondition != null) {
			merchantIdCondition.toWrapper(wrapper, COL_MERCHANT_ID);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回优惠券模板ID查询条件
	 * 
	 * @return couponTemplateIdCondition 优惠券模板ID查询条件
	 */
	public Condition<String> couponTemplateId() {
		this.couponTemplateIdCondition = new Condition<>();
		return this.couponTemplateIdCondition;
	}
	
	/**
	 * 获取优惠券模板ID查询条件
	 * 
	 * @return couponTemplateIdCondition 优惠券模板ID查询条件
	 */
	public Condition<String> getCouponTemplateIdCondition() {
		return couponTemplateIdCondition;
	}

	/**
	 * 设置优惠券模板ID查询条件
	 * 
	 * @param couponTemplateIdCondition 优惠券模板ID查询条件
	 */
	public void setCouponTemplateIdCondition(Condition<String> couponTemplateIdCondition) {
		this.couponTemplateIdCondition = couponTemplateIdCondition;
	}

	/**
	 * 构造并返回商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> merchantId() {
		this.merchantIdCondition = new Condition<>();
		return this.merchantIdCondition;
	}
	
	/**
	 * 获取商户ID查询条件
	 * 
	 * @return merchantIdCondition 商户ID查询条件
	 */
	public Condition<String> getMerchantIdCondition() {
		return merchantIdCondition;
	}

	/**
	 * 设置商户ID查询条件
	 * 
	 * @param merchantIdCondition 商户ID查询条件
	 */
	public void setMerchantIdCondition(Condition<String> merchantIdCondition) {
		this.merchantIdCondition = merchantIdCondition;
	}

}
